package org.javarosa.view;

import java.util.Vector;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.Spacer;
import javax.microedition.lcdui.StringItem;

import org.javarosa.core.api.IView;

public class MessageScreen extends Form implements IView {
	
	// MODEL VARIABLES
    private StringItem messageTextView;

    // BUSINESS METHODS
    
	public MessageScreen (String title, Vector<Command> commands, CommandListener commandListener) {
		
    	//#style submitPopup
		super(title);
		
		this.messageTextView = new StringItem(null, "");
		this.setCommandListener(commandListener);
		
		for (Command command : commands) {
			addCommand(command);
		}

		append(new Spacer(80, 0));
		append(this.messageTextView);
	}


	public void setMessage(String message) {
		this.messageTextView.setText(message);		
	}


	public Object getScreenObject() {
		return this;
	}

}
